package com.lion.tag;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

public class LionBaseTag extends TagSupport {
	private static final long serialVersionUID = 877832657697560116L;
	protected String id;
	protected String style;
	
	public HttpServletRequest getRequest(){
		return (HttpServletRequest) pageContext.getRequest();
	}
	
	public String getContextPath(){
		return getRequest().getContextPath();
	}
	
	public void write(StringBuilder sb) throws JspException{
		try {
			pageContext.getOut().write(sb.toString());
		} catch (IOException e) {
			throw new JspException(e);
		}
	}
	
	/**
	 * @return the id
	 */
	@Override
	public String getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	@Override
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @return the style
	 */
	public String getStyle() {
		return style;
	}

	/**
	 * @param style
	 *            the style to set
	 */
	public void setStyle(String style) {
		this.style = style;
	}

}
